/**
 *
 * Copyright 2009 Bill Garrett (memesis@gmail.com)
 *
 * Licensed under the Apache License, Version 2.0 (the "License"); you may not use
 * this file except in compliance with the License.  You may obtain a copy of the
 * License at
 * 
 * http://www.apache.org/licenses/LICENSE-2.0
 * 
 * Unless required by applicable law or agreed to in writing, software distributed
 * under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
 * CONDITIONS OF ANY KIND, either express or implied. See the License for the specific
 * language governing permissions and limitations under the License. 
 */
package org.memesis.pandorasbook;

import javax.swing.JInternalFrame;

/**
 * A class for managing the internal frame on the Storybook desktop.
 * 
 * @author garrett
 */
@SuppressWarnings("serial")
public class PandoraAppletFrame extends JInternalFrame {
	private PandoraApplet applet;
	
	public PandoraAppletFrame(PandoraApplet applet) {
		super("Untitled Window", true, true, true, true);
		this.applet = applet;
		initializeFrame();
	}
	
	public PandoraApplet getApplet() {
		return this.applet;
	}
	
	private void initializeFrame() {
		this.setDefaultCloseOperation(JInternalFrame.DISPOSE_ON_CLOSE);
		
		// JInternalFrame must have a minimum size at startup
		this.setSize(50, 50);
		
		// Do not show the frame here, since the Desktop needs to add a listener first
	}
}
